using System;
using System.Collections.Generic;
using System.Text;

namespace Cards.Util
{
    public enum CARD_PLAYING_KIND
    {
        VNPOCKER = 0,
        BLACKJACK,
        CATTE
    };

    public enum PLAYER_TYPE
    {
        HUMAN = 0,
        COMPUTER,
        DISABLED
    };

    public enum BLACKJACK_RANK
    {
        R_DOUBLE_ACE_JACK = 0,
        R_ACE_JACK,
        R_FIVE_CARDS,
        R_TWENTY_FIRST,
        R_AVERAGE,
        R_OUT_RANGE,
        R_UNKNOWN
    };

    /// <summary>
    /// 
    /// </summary>
    public enum MULTI_PLAYER_TYPE
    {
        SINGLE_PLAYER = 0,
        MULTI_PLAYER_SERVER,
        MULTI_PLAYER_CLIENT
    }

    public enum EDIRECTIONS
    {
        D_N = 0,
        D_E,
        D_S,
        D_W,
        D_NE,
        D_SE,
        D_SW,
        D_NW
    }

    public enum EDISTRIBUTE_MODE
    {
        ONE_CARD = 0,
        ALL
    }

    public class Constants
    {
        public static int s_TotalOfCards = 52;
        public static int s_PlayerNumberOfCards = 13;
        public static int s_maxPlayers = 4;

        public static int s_cardWidth = 78;
        public static int s_cardHeight = 100;
        public static int s_tableWidth = 900;
        public static int s_tableHeight = 700;

        public static int s_avatarWidth = 60;
        public static int s_avatarHeight = 60;

        public static int s_playerWidth = s_tableWidth/2;
        public static int s_playerHeight = s_tableHeight/3;

        public static int s_alphax = 20;
        public static int s_alphay = 20;

        public static int s_mobility = 15;

        public static int s_cardContainerWidth = s_playerWidth;
        public static int s_cardContainerHeight = s_playerHeight - s_alphay*3;
                
        public static int s_posx_player = 0;
        public static int s_posy_player = s_alphay;

        //vi tri nguoi choi
        public static int s_posx_player1 = 0;
        public static int s_posy_player1 = s_playerHeight * 2 - s_alphay*2;

        public static int s_posx_player2 = s_playerWidth + s_alphax;
        public static int s_posy_player2 = s_playerHeight * 2 - s_alphay*2;

        public static int s_posx_player3 = s_playerWidth + s_alphax;
        public static int s_posy_player3 = s_alphay;

        public static int s_posx_player4 = 0;
        public static int s_posy_player4 = s_alphay;
        //

        public static int s_space_bw_two_cards = 20;
        public static int ORIGINAL_MONEY = 500000;

        public static int BABICH    = 1;//"3a";
        public static int BACHUON   = 2;//"3b";
        public static int BARO      = 3;//"3c";
        public static int BACO      = 4;//"3d";
        public static int BONBICH   = 5;//"4a";
        public static int BONCHUON  = 6;//"4b";
        public static int BONRO     = 7;//"4c";
        public static int BONCO     = 8;//"4d";
        public static int NAMBICH   = 9;//"5a";
        public static int NAMCHUON  = 10;//"5b";
        public static int NAMRO     = 11;//"5c";
        public static int NAMCO     = 12;//"5d";
        public static int SAUBICH   = 13;//"6a";
        public static int SAUCHUON  = 14;//"6b";
        public static int SAURO     = 15;//"6c";
        public static int SAUCO     = 16;//"6d";
        public static int BAYBICH   = 17;//"7a";
        public static int BAYCHUON  = 18;//"7b";
        public static int BAYRO     = 19;//;//"7c";
        public static int BAYCO     = 20;//"7d";
        public static int TAMBICH   = 21;//"8a";
        public static int TAMCHUON  = 22;//"8b";
        public static int TAMRO     = 23;//"8c";
        public static int TAMCO     = 24;//"8d";
        public static int CHINBICH  = 25;//"9a";
        public static int CHINCHUON = 26;//"9b";
        public static int CHINRO    = 27;//"9c";
        public static int CHINCO    = 28;//"9d";
        public static int MUOIBICH  = 29;//"10a";
        public static int MUOICHUON = 30;//"10b";
        public static int MUOIRO    = 31;//"10c";
        public static int MUOICO    = 32;//"10d";
        public static int BOIBICH   = 33;//"Ja";
        public static int BOICHUON  = 34;//"Jb";
        public static int BOIRO     = 35;//"Jc";
        public static int BOICO     = 36;//"Jd";
        public static int DAMBICH   = 37;//"Qa";
        public static int DAMCHUON  = 38;//"Qb";
        public static int DAMRO     = 39;//"Qc";
        public static int DAMCO     = 40;//"Qd";
        public static int GIABICH   = 41;//"Ka";
        public static int GIACHUON  = 42;//"Kb";
        public static int GIARO     = 43;//"Kc";
        public static int GIACO     = 44;//"Kd";
        public static int ACHBICH   = 45;//"1a";
        public static int ACHCHUON  = 46;//"1b";
        public static int ACHRO     = 47;//"1c";
        public static int ACHCO     = 48;//"1d";
        public static int HAIBICH   = 49;//"2a";
        public static int HAICHUON  = 50;//"2b";
        public static int HAIRO     = 51;//"2c";
        public static int HAICO     = 52;//"2d";

        public static int GT_BA     = 3;
        public static int GT_BON    = 4;
        public static int GT_NAM    = 5;
        public static int GT_SAU    = 6;
        public static int GT_BAY    = 7;
        public static int GT_TAM    = 8;
        public static int GT_CHIN   = 9;
        public static int GT_MUOI   = 10;
        public static int GT_BOI    = 11;
        public static int GT_DAM    = 12;
        public static int GT_GIA    = 13;
        public static int GT_ACH    = 14;
        public static int GT_HEO    = 15;

        public static int GT_BLACKJACK_REALVALUE = 10;

        public static int VNPOCKER_NUMOFCARDS = 13;
        public static int VNPOCKER_MAX_PLAYERS = 4;
        public static int VNPOCKER_PLAYERS_BORDER_ALPHAY = 5;

        public static int BLACKJACK_NUMOFCARDS = 2;
        public static int BLACKJACK_MAX_NUMOFCARDS = 5;
        public static int BLACKJACK_MAX_PLAYERS = 8;

        public static int CATTE_NUMOFCARDS = 6;
        public static int CATTE_MAX_PLAYERS = 10;

        public static int PACK_OF_CARDS_HEIGHT = 4;
        public static int PACK_OF_CARDS_SPACE = 3;

        public static string ENGLISH = "English";
        public static string VIETNAMESE = "Tiếng Việt";

        public static String DEFAULT_PLAYER_NAME = "Vô danh";


        //Network
        public static int MAX_DATA_TRANSFER = 1024;

    }

    public class NetworkConstants
    {
        public const String MESSAGETYPE_SEPARATOR = ":";
        public const String MESSAGETYPE_SUBSEPARATOR = ".";

        public const String MESSAGETYPE_BROADCAST = "BROADCAST";
        public const String MESSAGETYPE_PLAYERNAME = "PLAYERNAME";
        public const String MESSAGETYPE_MOVE = "MOVE";
        public const String MESSAGETYPE_SKIP = "SKIP";

        public const String MESSAGETYPE_SERVER_BROADCAST_PLAYER_LIST = "BROADCAST_PLAYERLIST";
        public const String MESSAGETYPE_SERVER_WELCOME = "WELCOME";
        public const String MESSAGETYPE_SERVER_START_GAME = "START";
        public const String MESSAGETYPE_SERVER_CONTINUE_GAME = "CONTINUE";
    }
}